package com.bdqn.tour.service.impl;

import com.bdqn.tour.dao.HqfSearchMessageDao;
import com.bdqn.tour.dao.impl.Hqfsearchmessagedaoimpl;
import com.bdqn.tour.pojo.PageInfo;
import com.bdqn.tour.pojo.Scenic;
import com.bdqn.tour.service.HqfSearchMessageService;

import java.util.List;

public class hqfSearchMessageServiceImpl implements HqfSearchMessageService {
    HqfSearchMessageDao dao = new Hqfsearchmessagedaoimpl();

    //查询所有景点信息
    public List<Scenic> getScenicList(){
        HqfSearchMessageDao hqfSearchMessageDao = new Hqfsearchmessagedaoimpl();
        return hqfSearchMessageDao.getScenicList();
    }




    //分页查询景点信息的功能
    @Override
    public PageInfo<Scenic> getPageEmp(int pageNum, int pageSize) {
            PageInfo<Scenic> pageInfo = new PageInfo<>();
        pageInfo.setPageSize(pageSize);
        pageInfo.setCurrPageNo(pageNum);
        //查询总条数
        pageInfo.setTotals(dao.getEmpsPageCount());
        int startIndex= (pageInfo.getCurrPageNo() - 1 ) * pageInfo.getPageSize();
        pageInfo.setList(dao.getEmpsByPage(startIndex,pageInfo.getPageSize()));

        return pageInfo;
    }
}
